// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdGroup
 */
public class AdGroupDaoImpl
    extends org.tinaelle.server.domain.AdGroupDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdGroupDao#toAdGroupDTO(org.tinaelle.server.domain.AdGroup)
     */
    public org.tinaelle.common.dto.AdGroupDTO toAdGroupDTO(final org.tinaelle.server.domain.AdGroup entity)
    {
        return super.toAdGroupDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdGroup loadAdGroupFromAdGroupDTO(org.tinaelle.common.dto.AdGroupDTO adGroupDTO)
    {
        org.tinaelle.server.domain.AdGroup adGroup = this.load(adGroupDTO.getAdGroupId());
        if (adGroup == null)
        {
            adGroup = org.tinaelle.server.domain.AdGroup.Factory.newInstance();
        }
        return adGroup;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdGroupDao#adGroupDTOToEntity(org.tinaelle.common.dto.AdGroupDTO)
     */
    public org.tinaelle.server.domain.AdGroup adGroupDTOToEntity(org.tinaelle.common.dto.AdGroupDTO adGroupDTO)
    {
        org.tinaelle.server.domain.AdGroup entity = this.loadAdGroupFromAdGroupDTO(adGroupDTO);
        this.adGroupDTOToEntity(adGroupDTO, entity, true);
        return entity;
    }
}